﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script src="../scripts/boot.js" type="text/javascript"></script>
    <script type="text/javascript">
        $.ajax({
            url: "../data/system.aspx?method=110",
            async: false,
            success: function (text) {
                if (text == "no")
                    window.location = "../system/error.html";
                else if (text == "out") {
                    var loginWindow = parent.mini.get("loginWindow");
                    if (!loginWindow.visible)
                        loginWindow.show();
                    var tabs = parent.mini.get("mainTabs");
                    var tab = tabs.getTab("tab$110");
                    tabs.removeTab(tab);
                }
            }
        });
    </script>
</head>
<body>
    <div class="mini-toolbar" style="border-bottom: 0;">
        <table>
            <tr>
                <td>
                    岗位类别：
                    <input id="type1" class="mini-combobox" textField="jt_name" valueField="jt_id" onvaluechanged="onTypepChanged"
                        style="width: 150px;" url="../data/system.aspx?method=CbxJobTypeP" value="0"/>
                    <input id="type2" class="mini-combobox" textField="jt_name" valueField="jt_id"
                        style="width: 150px;"/>
                    发布日期：
                    <input id="sdate" class="mini-datepicker"/>
                    至
                    <input id="edate" class="mini-datepicker"/>
                    <a class="mini-button" iconcls="icon-search" plain="true" onclick="search();">查询</a>
                    <span class="separator"></span>
                    <a class="mini-button" plain="true" iconcls="icon-excel" onclick="excelRow()">查询结果导出</a>
                </td>
            </tr>
        </table>
    </div>
    <div class="mini-fit" >
        <div id="datagrid1" class="mini-datagrid" style="width:100%;height:100%;" allowresize="true"
            idfield="id" url="../data/system.aspx?method=SJob" sizeList="[15,20,50,100]" pageSize="15">
            <div property="columns">
                <div type="indexcolumn"></div>
                <div field="cu_name" width="200px" headeralign="center" align="center" allowsort="true">
                    企业名称</div>
                <div field="re_name" width="120px" headeralign="center" align="center" allowsort="true">
                    职位名称</div>
                <div field="re_num" width="60px" headeralign="center" align="center" allowsort="true" renderer="onNumRenderer">
                    招聘人数</div>
                <div field="area" width="60px" headeralign="center" align="center" allowsort="true">
                    工作地区</div>
                <div field="sex" width="60px" headeralign="center" align="center" allowsort="true">
                    性别要求</div>
                <div field="kind" width="60px" headeralign="center" align="center" allowsort="true">
                    工作性质</div>
                <div field="edu" width="80px" headeralign="center" align="center" allowsort="true" renderer="onEduRenderer">
                    学历要求</div>
                <div field="target" width="170px" headeralign="center" align="center" allowsort="true">
                    招聘对象</div>
                <div field="jobtype1" width="200px" headeralign="center" align="center" allowsort="true" renderer="onJobtype1Renderer">
                    岗位类别1</div>
                <div field="jobtype2" width="200px" headeralign="center" align="center" allowsort="true" renderer="onJobtype2Renderer">
                    岗位类别2</div>
                <div field="re_age" width="60px" headeralign="center" align="center" allowsort="true" renderer="onAgeRenderer">
                    年龄要求</div>
                <div field="re_pay1" width="100px" headeralign="center" align="center" allowsort="true" renderer="onPayRenderer">
                    待遇</div>
                <div field="re_hits" width="60px" headeralign="center" align="center" allowsort="true">
                    点击率</div>
                <div field="re_resumenum" width="60px" headeralign="center" align="center" allowsort="true">
                    应聘数</div>
                <div field="re_inserttime" width="80px" headeralign="center" align="center" allowsort="true" dateFormat="yyyy-MM-dd">
                    发布日期</div>
            </div>
        </div>
    </div>
    <iframe id="exportIFrame" style="display:none;"></iframe>
    <!--导出Excel相关HTML-->
     <form id="excelForm" action="../data/download.aspx?method=ExcelJob" method="post" target="excelIFrame">
        <input type="hidden" name="type1" id="Hidden1" />
        <input type="hidden" name="type2" id="Hidden2" />
        <input type="hidden" name="sdate" id="Hidden3" />
        <input type="hidden" name="edate" id="Hidden4" />
    </form>
    <iframe id="excelIFrame" name="excelIFrame" style="display:none;"></iframe>
    <script type="text/javascript">
        $.ajaxSetup({
            contentType: "application/x-www-form-urlencoded;charset=utf-8",
            complete: function (XMLHttpRequest, textStatus) {
                if (XMLHttpRequest.responseText == "out") {
                    var loginWindow = parent.mini.get("loginWindow");
                    if (!loginWindow.visible)
                        loginWindow.show();
                }
            }
        });

        mini.parse();

        var myDate = new Date();
        var year = myDate.getFullYear();
        mini.get("sdate").setValue(myDate.getFullYear() + "/" + (myDate.getMonth()) + "/1");
        mini.get("edate").setValue(myDate.getFullYear() + "/" + (myDate.getMonth() + 1) + "/1");
        var grid = mini.get("datagrid1");
        search();

        function search() {
            var type1 = mini.get("type1").getValue();
            var type2 = mini.get("type2").getValue();
            var sdate = mini.get("sdate").getText();
            var edate = mini.get("edate").getText();
            $("#Hidden1").val(type1);
            $("#Hidden2").val(type2);
            $("#Hidden3").val(sdate);
            $("#Hidden4").val(edate);

            grid.load({ type1: type1, type2: type2, sdate: sdate, edate: edate });
            grid.sortBy("re_cuno", "desc");
        }

        function onTypepChanged(e) {
            var type1 = mini.get("type1").getValue();
            mini.get("type2").setValue("");
            var url = "../data/system.aspx?method=CbxJobTypeByP&id=" + type1
            mini.get("type2").setUrl(url);
            mini.get("type2").select(0);
        }

        function onNumRenderer(e) {
            if (e.value == 0)
                return "若干";
            return e.value;
        }

        function onEduRenderer(e) {
            var record = e.record;
            if (record.re_edu2 != null)
                return e.value + record.re_edu2;
            return e.value;
        }

        function onJobtype1Renderer(e) {
            var record = e.record;
            if (record.jobtype11 != null)
                return e.value + '(' + record.jobtype11 + ')';
            return e.value;
        }

        function onJobtype2Renderer(e) {
            var record = e.record;
            if (record.jobtype22 != null)
                return e.value + '(' + record.jobtype22 + ')';
            return e.value;
        }

        function onAgeRenderer(e) {
            var record = e.record;
            if (e.value != null && e.value != '')
                return e.value;
            return '不限';
        }

        function onPayRenderer(e) {
            var record = e.record;
            if (record.re_pay1 == 1)
                return "1000~1500";
            else if (record.re_pay1 == 2)
                return "1500~2000";
            else if (record.re_pay1 == 3)
                return "2000~3000";
            else if (record.re_pay1 == 4)
                return "3000~5000";
            else if (record.re_pay1 == 5)
                return "5000~10000";
            else if (record.re_pay1 == 6)
                return "10000以上";
            else
                return "面议";
        }

        function excelRow() {
            mini.confirm("确定导出招聘职位情况吗？", "系统提示",
                function (action) {
                    if (action == "ok") {
                        $("#excelForm").submit();
                    }
                }
            );
        }
    </script>
</body>
</html>